use "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 5 Neighborhoods\Data\Chapter 5 CIs.dta", clear

twoway (scatter pointestimateCX var5 if var5>.5 & var5<9, mcolor(black) mlabel(city) mlabcolor(black)) ///
(rcap upperciJF lowerciJF var5 if var5>.5 & var5<9, lcolor(black) lwidth(thin)) (scatter pointestimateJF var5 if var5>.5 & var5<9, mcolor(black) mlabel(city) mlabcolor(black)), ///
ytitle("Feeling Thermometer Evaluation" "(0-10 scale)")  xline(2.5 6.5, lcolor(black)) xline(4.5, lcolor(black)) legend(off) xscale(range(.5 8.5)) ///
xlab(1.5 "", nolab notick) xtitle("") yscale(range(2 7)) ///
ytick(2(1)7) ylab(2(1)7) graphregion(color(white) margin(medlarge)) plotregion(lstyle(yxline) lcolor(black))  ///
text(6.85 1.5 "Evaluation of PMDB" "by PTistas", size(small) justification(center)) text(6.85 3.5 "Evaluation of PT" "by PMDBistas", size(small) justification(center)) ///
text(6.85 5.5 "Evaluation of CUT" "by PMDBistas", size(small) justification(center)) text(6.85 7.5 "Evaluation of MST" "by PMDBistas", size(small) justification(center))

*Figure 5.2
twoway (scatter pointestimateCX var5 if var5>8.5, mcolor(black) mlabel(city) mlabcolor(black) msym(S)) (rcap upperciCX lowerciCX var5 if var5>8.5, lcolor(black)  lwidth(thin))  ///
(rcap upperciJF lowerciJF var5 if var5>8.5, lcolor(black) lwidth(thin)) (scatter pointestimateJF var5 if var5>8.5, mcolor(black) mlabel(city) mlabcolor(black)), ///
ytitle("{bf:Feeling Thermometer Score}" "(in standard deviations)")  xline(10.5 14.5, lcolor(black)) xline(12.5, lcolor(black)) legend(off) ///
xlab(10 "", nolab notick) xtitle("") yscale(range(-1 .35)) xscale(range(8.5 16.5)) yline(0, lcolor(black) lwidth(thin)) ///
ytick(-1(.25).25) ylab(-1(.25).25) graphregion(color(white) margin(medlarge)) plotregion(lstyle(yxline) lcolor(black))  ///
text(.3 9.5 "Evaluation of PMDB" "by PTistas", size(small) justification(center)) text(.3 11.5 "Evaluation of PT" "by PMDBistas", size(small) justification(center)) ///
text(.3 13.5 "Evaluation of CUT" "by PMDBistas", size(small) justification(center)) text(.3 15.5 "Evaluation of MST" "by PMDBistas", size(small) justification(center)) ///
text(-1 16 "{it:N}=399", size(small)) text(-1 15 "{it:N}=358", size(small)) text(-1 14 "{it:N}=342", size(small)) text(-1 13 "{it:N}=314", size(small)) text(-1 12 "{it:N}=364", size(small)) text(-1 11 "{it:N}=337", size(small)) ///
text(-1 10 "{it:N}=453", size(small)) text(-1 9 "{it:N}=500", size(small))

graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 5 Neighborhoods\Figures\Chapter 5 CIs.tif", as(tif) replace
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR5_2.tif", as(tif) replace width(1500)
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR5_2.pdf", as(pdf) replace

xyz
*(rcap upperciCX lowerciCX var5 if var5>.5 & var5<9, lcolor(gs8) lwidth(thin)) 
*
